//
//  MethodView.m
//  FoodFamily
//
//  Created by dlios on 15-6-22.
//  Copyright (c) 2015年 guoBang. All rights reserved.
//

#import "MethodView.h"

@implementation MethodView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self methodView];
    }
    return self;
}
-(void)methodView{
    /*self.knowledgebutton = [[UIButton alloc]initWithFrame:CGRectMake(180*COEFFICIENTW, self.frame.size.height-104-49, 110*COEFFICIENTW, 40)];*/
    
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, WIDTH*COEFFICIENTW, 100)];
    view.backgroundColor = [UIColor whiteColor];
    [self addSubview:view];
    UIImageView *imageview = [[UIImageView alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
    imageview.image = [UIImage imageNamed:@"beijing.png"];
    [self addSubview:imageview];

    
    self.namelabel = [[UILabel alloc]initWithFrame:CGRectMake(10*COEFFICIENTW, 30, 150*COEFFICIENTH, 20)];
self.namelabel.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:self.namelabel];
    self.englishNamelable = [[UILabel alloc]initWithFrame:CGRectMake(10*COEFFICIENTW, 50, 150*COEFFICIENTH, 20)];
    self.englishNamelable.font = [UIFont systemFontOfSize:14];
    self.englishNamelable.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:self.englishNamelable];
#pragma 烹饪时间
    UILabel *labla1 = [[UILabel alloc]initWithFrame:CGRectMake(180*COEFFICIENTW, 15, 80, 20)];
    labla1.backgroundColor = [UIColor clearColor];
    labla1.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    labla1.text = @"烹饪时间:";
    [self addSubview:labla1];
    self.timelength = [[UILabel alloc]initWithFrame:CGRectMake(260*COEFFICIENTW+5, 15, 80, 20)];
     self.timelength.font = [UIFont systemFontOfSize:14];
    self.timelength.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:self.timelength];
    
#pragma    口味
    UILabel *label2 = [[UILabel alloc]initWithFrame:CGRectMake(180*COEFFICIENTW, 35, 80*COEFFICIENTH, 20)];
    label2.text = @"口味:";
    label2.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:label2];
    self.tastelable = [[UILabel alloc]initWithFrame:CGRectMake(260*COEFFICIENTW+5, 35, 80*COEFFICIENTH, 20)];
     self.tastelable.font = [UIFont systemFontOfSize:14];
    self.tastelable.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:self.tastelable];
#pragma 烹饪方法
    UILabel *label3 = [[UILabel alloc]initWithFrame:CGRectMake(180*COEFFICIENTW, 55, 80, 20)];
    label3.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    label3.text = @"烹饪方法:";
    [self addSubview:label3];
    self.cookingMethodlable = [[UILabel alloc]initWithFrame:CGRectMake(260*COEFFICIENTW+5, 55, 80, 20)];
     self.cookingMethodlable.font = [UIFont systemFontOfSize:14];
    self.cookingMethodlable.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:self.cookingMethodlable];
#pragma 功效
    UILabel *label4 = [[UILabel alloc]initWithFrame:CGRectMake(180*COEFFICIENTW, 75, 80*COEFFICIENTH, 20)];
    label4.text = @"功效:";
    label4.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:label4];
    self.effectlable = [[UILabel alloc]initWithFrame:CGRectMake(260*COEFFICIENTW+5, 75, 80*COEFFICIENTH, 20)];
     self.effectlable.font = [UIFont systemFontOfSize:14];
    self.effectlable.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:self.effectlable];
    
#pragma 适合人群
    UILabel *label5 = [[UILabel alloc]initWithFrame:CGRectMake(180*COEFFICIENTW, 95, 80, 20)];
    label5.text = @"适合人群:";
    label5.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview: label5];
    self.fittingCrowdlable = [[UILabel alloc]initWithFrame:CGRectMake(260*COEFFICIENTW+5, 95,80, 20)];
    self.fittingCrowdlable.font = [UIFont systemFontOfSize:14];
    self.fittingCrowdlable.textColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:self.fittingCrowdlable];
    
    UIView *vvvv = [[UIView alloc]initWithFrame:CGRectMake(0*COEFFICIENTW, 120, 375*COEFFICIENTH, 2)];
    vvvv.backgroundColor = [UIColor colorWithRed:101/255.0 green:48/255.0 blue:2/255.0 alpha:1];
    [self addSubview:vvvv];
}
-(void)setMov:(Movie *)mov
{
    if (_mov!= mov) {
        [_mov release];
        _mov = [mov retain];
    }
    
    self.namelabel.text = mov.name;
    self.englishNamelable.text = mov.englishName;
    self.timelength.text = mov.timeLength;
    self.tastelable.text = mov.taste;
    self.cookingMethodlable.text = mov.cookingMethod;
    self.effectlable.text = mov.effect;
    self.fittingCrowdlable.text = mov.fittingCrowd;
    
  

}






@end
